<?php

declare(strict_types=1);

/**
 * This file is part of Hyperf.
 *
 * @link     https://www.hyperf.io
 * @document https://hyperf.wiki
 * @contact  group@hyperf.io
 * @license  https://github.com/hyperf/hyperf/blob/master/LICENSE
 */

use Hyperf\HttpServer\Router\Router;

//Router::addRoute(['GET', 'POST', 'HEAD'], '/', 'App\Controller\IndexController@index');
//Router::addRoute(['GET', 'POST', 'HEAD'], '/admin', 'App\Controller\IndexController@admin');


Router::get('/OceanRubbishSend', function () {
    App(\App\Library\Ocean\OceanRubbishCreate::class)->run();
});
Router::get('/test', function () {
    app(\yjHyperfAdminPligin\Email\Email::class)->send();
});

Router::get('/favicon.ico', function () {
    return '';
});

//Router::get('/pic', function () {
//    $fullPath = base_path().DIRECTORY_SEPARATOR.'pic'.DIRECTORY_SEPARATOR.'demo.jpg';
//
//    return response()->stream(function () use ($fullPath) {
//        echo file_get_contents($fullPath);
//    }, 200, ['Content-Type' => 'image/jpeg']);
//});

Router::addServer('ws', function () {
    Router::get('/', 'App\Controller\Ws\WsController');
//    Router::get('/wechat', \Wechat\Controller\UserController::class);
    Router::get('/user', \App\Controller\Ws\UserWsController::class);
});

